<!DOCTYPE html>
<html>

<head>
    <meta charset="utf-8">
    <meta name="viewport" content="maximum-scale=1.0,minimum-scale=1.0,user-scalable=0,width=device-width,initial-scale=1.0" />
    <title>患者_评估书</title>
    <link rel="stylesheet" type="text/css" href="../css/api.css" />
    <link rel="stylesheet" type="text/css" href="../css/style.css" />
    <link rel="stylesheet" type="text/css" href="../css/aui.2.0.css" />
    <link rel="stylesheet" type="text/css" href="../css/BasicPatientInformation.css" />
</head>

<body>
    <main id="app">
        <div class="aui-padded-5" id="tab1-con">
            <div id="tab1-con1">
                <main id="app">
                    <div class="aui-content aui-margin-b-15">
                        <ul class="aui-list aui-form-list">
                            <li class="aui-list-item">
                                <div class="aui-list-item-label">
                                    生命体征：T
                                </div>
                                <div class="aui-list-item-label aui-list-item-input-pinggu">
                                    <span><input id="PG_F_tizheng" style="width:100%" type="text"></span>
                                </div>
                                <div class="aui-list-item-label">
                                    ℃
                                </div>
                            </li>
                            <li class="aui-list-item">
                                <div class="aui-list-item-label">
                                    生命体征：P
                                </div>
                                <div class="aui-list-item-label aui-list-item-input-pinggu">
                                    <span><input id="PG_F_tizheng1" style="width:100%" type="text"></span>
                                </div>
                                <div class="aui-list-item-label">
                                    次/分
                                </div>
                            </li>
                            <li class="aui-list-item">
                                <div class="aui-list-item-label">
                                    生命体征：R
                                </div>
                                <div class="aui-list-item-label aui-list-item-input-pinggu">
                                    <span><input id="PG_F_tizheng2" style="width:100%" type="text"></span>
                                </div>
                                <div class="aui-list-item-label">
                                    次/分
                                </div>
                            </li>
                            <li class="aui-list-item">
                                <div class="aui-list-item-label">
                                    治疗评定：BP
                                </div>
                                <div class="aui-list-item-label aui-list-item-input-pinggu">
                                    <span><input id="PG_F_tizheng3" style="width:100%" type="text"></span>
                                </div>
                                <div class="aui-list-item-label">
                                    mm/gg
                                </div>
                            </li>
                            <li class="aui-list-item">
                                <div class="aui-list-item-inner">
                                    <div class="aui-list-item-label">
                                        入科方式
                                    </div>
                                    <div class="aui-list-item-input aui-list-item-input-pinggu" id="rkfs">
                                    </div>
                                </div>
                            </li>
                            <li class="aui-list-item">
                                <div class="aui-list-item-inner">
                                    <div class="aui-list-item-label">
                                        既往史
                                    </div>
                                    <div class="aui-list-item-input aui-list-item-input-pinggu" id="jws">

                                    </div>
                                </div>
                            </li>
                            <li class="aui-list-item">
                                <div class="aui-list-item-inner">
                                    <div class="aui-list-item-label">
                                        传染病史
                                    </div>
                                    <div class="aui-list-item-input aui-list-item-input-pinggu" id="crbs">

                                    </div>
                                </div>
                            </li>
                            <li class="aui-list-item">
                                <div class="aui-list-item-inner">
                                    <div class="aui-list-item-label">
                                        过敏史
                                    </div>
                                    <div class="aui-list-item-input aui-list-item-input-pinggu" id="gms">

                                    </div>
                                </div>
                            </li>
                            <li class="aui-list-item">
                                <div class="aui-list-item-inner">
                                    <div class="aui-list-item-label">
                                        意识
                                    </div>
                                    <div class="aui-list-item-input aui-list-item-input-pinggu" id="ys">

                                    </div>
                                </div>
                            </li>
                            <li class="aui-list-item">
                                <div class="aui-list-item-inner">
                                    <div class="aui-list-item-label">
                                        营养状况
                                    </div>
                                    <div class="aui-list-item-input aui-list-item-input-pinggu" id="yyzk">

                                    </div>
                                </div>
                            </li>
                            <li class="aui-list-item">
                                <div class="aui-list-item-inner">
                                    <div class="aui-list-item-label">
                                        语言功能
                                    </div>
                                    <div class="aui-list-item-input aui-list-item-input-pinggu" id="yygn">

                                    </div>
                                </div>
                            </li>
                            <li class="aui-list-item">
                                <div class="aui-list-item-inner">
                                    <div class="aui-list-item-label">
                                        自理评估
                                    </div>
                                    <div class="aui-list-item-input aui-list-item-input-pinggu" id="zlpg">

                                    </div>
                                </div>
                            </li>
                            <li class="aui-list-item">
                                <div class="aui-list-item-inner">
                                    <div class="aui-list-item-label">
                                        压疮
                                    </div>
                                    <div class="aui-list-item-input aui-list-item-input-pinggu" id="yc">

                                    </div>
                                </div>
                            </li>
                            <li class="aui-list-item">
                                <div class="aui-list-item-inner">
                                    <div class="aui-list-item-label">
                                        患者依从性
                                    </div>
                                    <div class="aui-list-item-input aui-list-item-input-pinggu" id="hzycx">

                                    </div>
                                </div>
                            </li>
                            <li class="aui-list-item">
                                <div class="aui-list-item-inner">
                                    <div class="aui-list-item-label">
                                        心理
                                    </div>
                                    <div class="aui-list-item-input aui-list-item-input-pinggu" id="xl">

                                    </div>
                                </div>
                            </li>
                            <li class="aui-list-item">
                                <div class="aui-list-item-inner aui-list-item-center aui-list-item-btn">
                                    <div class="aui-btn aui-btn-info aui-margin-r-5" onclick="AddEntryEvaluation()">提交</div>
                                </div>

                            </li>

                        </ul>
                    </div>
                </main>
            </div>

        </div>
    </main>
</body>
<script type="text/javascript" src="../script/api.js"></script>
<script src="../script/vue.js" charset="utf-8"></script>
<script src="../js/ToConfigure.js" charset="utf-8"></script>
<script src="../script/aui-toast.js" charset="utf-8"></script>
<script type="text/javascript">
    var vm = null;
    apiready = function() {
        //接收患者ID
        var F_ID = api.pageParam.F_ID;

        vm = new Vue({
            el: '#app',
            data: {
                F_ID: 0, //患者唯一标识
            },
            created() {
                if (F_ID !== undefined && F_ID !== '') {
                    this.F_ID = F_ID;
                }
                //查询评估书
                AssessmentBookDictionary(this.F_ID);
            }
        })
    }




    //查询评估书
    function AssessmentBookDictionary(F_ID) {
      //获取所属医院IP地址
      var Url_IP = ToConfigure_IP("Gorgeous");


        //查询评估信息
        var EvaluationInformation = new Object();
        //获取患者ID
        EvaluationInformation.F_reserveId = F_ID;
        if (EvaluationInformation.F_reserveId === '' || EvaluationInformation.F_reserveId === undefined) {
            return "";
        }
        //转换为json数据
        var EvaluationJson = JSON.stringify(EvaluationInformation);
        api.ajax({
            url:  Url_IP + 'HyperbaricOxygen/EntryEvaluation/AssessmentBookDictionary',
            method: 'post',
            data: {
                values: {
                    parms: EvaluationJson
                }
            }
        }, function(ret, err) {
            if (ret != "" && ret != null) {
                document.getElementById("PG_F_tizheng").value = ret[0].F_tizheng;
                document.getElementById("PG_F_tizheng1").value = ret[0].F_tizheng1;
                document.getElementById("PG_F_tizheng2").value = ret[0].F_tizheng2;
                document.getElementById("PG_F_tizheng3").value = ret[0].F_tizheng3;
                document.getElementById("rkfs").innerHTML = ret[0].rkfs;
                document.getElementById("jws").innerHTML = ret[0].jws;
                document.getElementById("crbs").innerHTML = ret[0].crbs;
                document.getElementById("gms").innerHTML = ret[0].gms;
                document.getElementById("ys").innerHTML = ret[0].ys;
                document.getElementById("yyzk").innerHTML = ret[0].yyzk;
                document.getElementById("yygn").innerHTML = ret[0].yygn;
                document.getElementById("zlpg").innerHTML = ret[0].zlpg;
                document.getElementById("yc").innerHTML = ret[0].yc;
                document.getElementById("hzycx").innerHTML = ret[0].hzycx;
                document.getElementById("xl").innerHTML = ret[0].xl;
            }
        });
    }


    //操作患者信息
    function AddEntryEvaluation() {

      var JsParms = new Object();
      JsParms.F_reserveId = vm.F_ID;
      if (JsParms.F_reserveId == undefined && JsParms.F_reserveId == "" && JsParms.F_reserveId == null) {
          return "";
      }

      //生命体征
      var F_tizheng = document.getElementById("PG_F_tizheng").value;
      if (F_tizheng != undefined && F_tizheng != "" && F_tizheng != null) {
          JsParms.F_tizheng = F_tizheng;
      }
      //生命体征1
      var F_tizheng1 = document.getElementById("PG_F_tizheng1").value;
      if (F_tizheng1 != undefined && F_tizheng1 != "" && F_tizheng1 != null) {
          JsParms.F_tizheng1 = F_tizheng1;
      }
      //生命体征2
      var F_tizheng2 = document.getElementById("PG_F_tizheng2").value;
      if (F_tizheng2 != undefined && F_tizheng2 != "" && F_tizheng2 != null) {
          JsParms.F_tizheng2 = F_tizheng2;
      }
      //生命体征3
      var F_tizheng3 = document.getElementById("PG_F_tizheng3").value;
      if (F_tizheng3 != undefined && F_tizheng3 != "" && F_tizheng3 != null) {
          JsParms.F_tizheng3 = F_tizheng3;
      }


      //入科方式
      var F_rukefangshi = $api.val($api.dom("input[name='F_rukefangshi']:checked"));
      if (F_rukefangshi != undefined && F_rukefangshi != "" && F_rukefangshi != null) {
          JsParms.F_rukefangshi = F_rukefangshi;
      }
      //既往史
      var jw = "";
      var F_jiwangshi = $api.domAll('input[name="F_jiwangshi"]');
      if (F_jiwangshi != undefined && F_jiwangshi != "") {
          for (var i = 0; i < F_jiwangshi.length; i++) {
              if (F_jiwangshi[i].checked) {
                  jw += F_jiwangshi[i].value + ",";
              }
          }
          jw = jw.substr(0, jw.length - 1);
          JsParms.F_jiwangshi = jw;
      }



      //传染病史
      var F_chuanranbing = $api.domAll('input[name="F_chuanranbing"]');
      if (F_chuanranbing != undefined && F_chuanranbing != "") {
          var cr = "";
          for (var i = 0; i < F_chuanranbing.length; i++) {
              if (F_chuanranbing[i].checked) {
                  cr += F_chuanranbing[i].value + ",";
              }
          }
          cr = cr.substr(0, cr.length - 1);
          JsParms.F_chuanranbing = cr;
      }


      //过敏史
      var F_guominshi = $api.val($api.dom("input[name='F_guominshi']:checked"));
      if (F_guominshi != undefined && F_guominshi != "" && F_guominshi != null) {
          JsParms.F_guominshi = F_guominshi;
      }
      //意识
      var F_yishi = $api.val($api.dom("input[name='F_yishi']:checked"));
      if (F_yishi != undefined && F_yishi != "" && F_yishi != null) {
          JsParms.F_yishi = F_yishi;
      }
      //营养状况
      var F_yingyang = $api.val($api.dom("input[name='F_yingyang']:checked"));
      if (F_yingyang != undefined && F_yingyang != "" && F_yingyang != null) {
          JsParms.F_yingyang = F_yingyang;
      }
      //语言功能
      var F_yuyan = $api.val($api.dom("input[name='F_yuyan']:checked"));
      if (F_yuyan != undefined && F_yuyan != "" && F_yuyan != null) {
          JsParms.F_yuyan = F_yuyan;
      }
      //自理评估
      var F_zili = $api.val($api.dom("input[name='F_zili']:checked"));
      if (F_zili != undefined && F_zili != "" && F_zili != null) {
          JsParms.F_zili = F_zili;
      }
      //压疮
      var F_yachuang = $api.val($api.dom("input[name='F_yachuang']:checked"));
      if (F_yachuang != undefined && F_yachuang != "" && F_yachuang != null) {
          JsParms.F_yachuang = F_yachuang;
      }
      //患者依从性
      var F_yicong = $api.val($api.dom("input[name='F_yicong']:checked"));
      if (F_yicong != undefined && F_yicong != "" && F_yicong != null) {
          JsParms.F_yicong = F_yicong;
      }
      //心理
      var F_xinli = $api.val($api.dom("input[name='F_xinli']:checked"));
      if (F_xinli != undefined && F_xinli != "" && F_xinli != null) {
          JsParms.F_xinli = F_xinli;
      }


      //api.getPrefs获取当前登录状态
      api.getPrefs({
          key: 'User_Id'
      }, function(ret, err) {
          //当偏好设置尚未设置或者曾设置后被移除后，返回值(ret.value)均为空。
          var val = ret.value;
          if (val != "") {
            //操作人员
            JsParms.F_CreatorUserId = val;
            //获取所属医院IP地址
            var Url_IP = ToConfigure_IP("Gorgeous");
            //获取操作信息
            var JsonStr =  JSON.stringify(JsParms);
            api.ajax({
                url:  Url_IP + 'HyperbaricOxygen/EntryEvaluation/Add_Assessment',
                method: 'post',
                dataType: 'String',
                data: {
                    values: {
                        parms: JsonStr
                    }
                }
            }, function(ret, err) {
              var toast = new auiToast();
                if (ret == "True") {
                    //查询评估书
                    AssessmentBookDictionary();
                    toast.success({
                        title: "提交成功",
                        duration: 2000
                    });
                } else {
                    var toast = new auiToast();
                    toast.fail({
                        title: "提交失败",
                        duration: 2000
                    });
                }
            });
          } else {
            toast.fail({
                title: "请登录高压氧pad,在进行提交信息,尝试失败请联系管理员！",
                duration: 2000
            });
          }
      });
    }






    //操作参数
    function GetParameters() {
        var JsParms = new Object();
        JsParms.F_reserveId = vm.F_ID;
        if (JsParms.F_reserveId == undefined && JsParms.F_reserveId == "" && JsParms.F_reserveId == null) {
            return "";
        }

        //生命体征
        var F_tizheng = document.getElementById("PG_F_tizheng").value;
        if (F_tizheng != undefined && F_tizheng != "" && F_tizheng != null) {
            JsParms.F_tizheng = F_tizheng;
        }
        //生命体征1
        var F_tizheng1 = document.getElementById("PG_F_tizheng1").value;
        if (F_tizheng1 != undefined && F_tizheng1 != "" && F_tizheng1 != null) {
            JsParms.F_tizheng1 = F_tizheng1;
        }
        //生命体征2
        var F_tizheng2 = document.getElementById("PG_F_tizheng2").value;
        if (F_tizheng2 != undefined && F_tizheng2 != "" && F_tizheng2 != null) {
            JsParms.F_tizheng2 = F_tizheng2;
        }
        //生命体征3
        var F_tizheng3 = document.getElementById("PG_F_tizheng3").value;
        if (F_tizheng3 != undefined && F_tizheng3 != "" && F_tizheng3 != null) {
            JsParms.F_tizheng3 = F_tizheng3;
        }


        //入科方式
        var F_rukefangshi = $api.val($api.dom("input[name='F_rukefangshi']:checked"));
        if (F_rukefangshi != undefined && F_rukefangshi != "" && F_rukefangshi != null) {
            JsParms.F_rukefangshi = F_rukefangshi;
        }
        //既往史
        var jw = "";
        var F_jiwangshi = $api.domAll('input[name="F_jiwangshi"]');
        if (F_jiwangshi != undefined && F_jiwangshi != "") {
            for (var i = 0; i < F_jiwangshi.length; i++) {
                if (F_jiwangshi[i].checked) {
                    jw += F_jiwangshi[i].value + ",";
                }
            }
            jw = jw.substr(0, jw.length - 1);
            JsParms.F_jiwangshi = jw;
        }



        //传染病史
        var F_chuanranbing = $api.domAll('input[name="F_chuanranbing"]');
        if (F_chuanranbing != undefined && F_chuanranbing != "") {
            var cr = "";
            for (var i = 0; i < F_chuanranbing.length; i++) {
                if (F_chuanranbing[i].checked) {
                    cr += F_chuanranbing[i].value + ",";
                }
            }
            cr = cr.substr(0, cr.length - 1);
            JsParms.F_chuanranbing = cr;
        }


        //过敏史
        var F_guominshi = $api.val($api.dom("input[name='F_guominshi']:checked"));
        if (F_guominshi != undefined && F_guominshi != "" && F_guominshi != null) {
            JsParms.F_guominshi = F_guominshi;
        }
        //意识
        var F_yishi = $api.val($api.dom("input[name='F_yishi']:checked"));
        if (F_yishi != undefined && F_yishi != "" && F_yishi != null) {
            JsParms.F_yishi = F_yishi;
        }
        //营养状况
        var F_yingyang = $api.val($api.dom("input[name='F_yingyang']:checked"));
        if (F_yingyang != undefined && F_yingyang != "" && F_yingyang != null) {
            JsParms.F_yingyang = F_yingyang;
        }
        //语言功能
        var F_yuyan = $api.val($api.dom("input[name='F_yuyan']:checked"));
        if (F_yuyan != undefined && F_yuyan != "" && F_yuyan != null) {
            JsParms.F_yuyan = F_yuyan;
        }
        //自理评估
        var F_zili = $api.val($api.dom("input[name='F_zili']:checked"));
        if (F_zili != undefined && F_zili != "" && F_zili != null) {
            JsParms.F_zili = F_zili;
        }
        //压疮
        var F_yachuang = $api.val($api.dom("input[name='F_yachuang']:checked"));
        if (F_yachuang != undefined && F_yachuang != "" && F_yachuang != null) {
            JsParms.F_yachuang = F_yachuang;
        }
        //患者依从性
        var F_yicong = $api.val($api.dom("input[name='F_yicong']:checked"));
        if (F_yicong != undefined && F_yicong != "" && F_yicong != null) {
            JsParms.F_yicong = F_yicong;
        }
        //心理
        var F_xinli = $api.val($api.dom("input[name='F_xinli']:checked"));
        if (F_xinli != undefined && F_xinli != "" && F_xinli != null) {
            JsParms.F_xinli = F_xinli;
        }


        //api.getPrefs获取当前登录状态
        api.getPrefs({
            key: 'User_Id'
        }, function(ret, err) {
            //当偏好设置尚未设置或者曾设置后被移除后，返回值(ret.value)均为空。
            var val = ret.value;
            if (val != "") {
              //操作人员
              JsParms.F_CreatorUserId = val;

              return JSON.stringify(JsParms);
            } else {
                //未登录
                return "";
            }
        });

    }

</script>

</html>
